<template>
    <div style="background-image: url(../../../static/img/top_back.jpg);">
        <div class="header">
            <div class="logo">四川工商学院学科竞赛</div>
            <div class="user-info">

            </div>
        </div>
        <img class="img1" style="margin-top: -1px" src="../../../static/img/aa.jpg" >
        <div class="bigtext">
            <p>四川工商学院学科竞赛</p>
            <div class="ms-login">
                <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="0px" class="demo-ruleForm">
                    <el-form-item prop="username">
                        <el-input v-model="ruleForm.username" placeholder="用户名"></el-input>
                    </el-form-item>
                    <el-form-item prop="password">
                        <el-input type="password" placeholder="密码" v-model="ruleForm.password" ></el-input>
                    </el-form-item>
                    <div class="login-btn">
                        <el-button type="primary" @click="login"style="width: 140px;float: left">登录</el-button>
                        <el-button  @click="zhuce" style="width: 140px;float: right">注册</el-button>
                        <el-button type="text" class="p1"@click="forget">忘记密码?</el-button>
                    </div>
                </el-form>
            </div>
        </div>
        <div class="bottom1">
            <div class="bottom_text">
                <p>
                    <img style="height: 100px;width: 100px" src="../../../static/img/weibo.jpg"/>
                    <img style="height: 100px;width: 100px" src="../../../static/img/weixin.jpg"/>
                    <img style="height: 100px;width: 100px" src="../../../static/img/QQ.jpg"/>
                </p>
                <p>成都校区：四川省成都市郫都区团结镇学院街65号 邮编：611745</p>
                <p>眉山校区：眉山市眉州大道岷东段9号 邮编：620000</p>
                <p>联系电话    招办：(028)87953080 校办:(028)87953896 人事处：(028)87953900 后勤处：(028)87953092</p>
                <p>Email：yb@stbu.edu.cn</p>
                <p>技术支持QQ群号:644301532 </p>
            </div>
        </div>
    </div>
</template>
<script>
    export default {
        data() {
            return {
                ruleForm: {
                    username: 'user',
                    password: '1234'
                },
                rules: {
                    username: [
                        { required: true, message: '请输入用户名', trigger: 'blur' }
                    ],
                    password: [
                        { required: true, message: '请输入密码', trigger: 'blur' }
                    ]
                },
                outerVisible: false,
                dialogFormVisible:false,
                formLabelWidth: '120px',
                form:{
                    username:'',
                    email:'',
                    tel:'',
                    student_id:'',
                    name:''
                },

            }
        },

        methods:{
            zhuce(index,row){
                this.$router.push('/registe')
            },
            forget(index,row){
                this.$router.push('/forget-password')

            },
            login(){
                if(!window.localStorage){
                    alert("浏览器支持localstorage");
                    return false;
                }else{
                    var storage=window.localStorage;
                    storage.clear();
                    storage.setItem("username",this.ruleForm.username);
                    console.log(storage["username"]);
                }
                this.$router.push('/home-page');
                // this.$axios.get('/text/login?'+
                //     'username='+this.ruleForm.username+
                //     '&password='+this.ruleForm.password
                // )
                //     .then((res) => {
                //     if(res.data.code==200)
                //         this.$router.push('/readme');
                //     else{
                //         this.$message.error('登录错误，请检查你的用户名和密码是否正确！！');
                //     }
                // })
            },
            denglu(){
                this.$router.push('/gateway')
            },
        }
    }
</script>
<style scoped>
    p{
        color: #f6faff;
    }
    .bottom1{
        position:relative;
        font-size: 16px;
        overflow: hidden;
        margin-top:16%;
        width: 100%;
    }
    .bottom_text{

        text-align: center;
        cursor: pointer;
    }
    .bottom_img{
        position: absolute;
        right: 50%;
        margin-top: 20px;
        width: 600px;
        background-color: #f6faff;
    }

    .ms-login{
        position: relative;
        left:50%;
        top:200px;
        width:300px;
        height:170px;
        margin:-150px 0 0 -190px;
        padding:40px;
        border-radius: 5px;
        background: #fff;
    }
    .login-btn{
        text-align: center;
    }
    .login-btn button{
        width:100%;
        height:40px;
    }
    .p1{
        position: relative;
        margin-top: 10px;
        float: left;
        left: 120px;
    }


    .bigtext{
        z-index: 1;
        text-align: center;
        color: #dddddd;
        font-family:圆体;
        font-size: 80px;
        margin-top: 150px;
    }
    .img1
    {
        position:absolute;
        height: 100%;
        width: 100%;
        left:0px;
        top:0px;
        z-index:-1;
    }
    .btntext{
        position: absolute;
        width:300px;
        height: 100px;
        line-height: 100px;
        top: 430px;
        left: 50%;
        margin-left: -85px;
        font-size: 56px;
        border: 2px solid #dddddd;
        border-radius: 3px;
        text-decoration: none;
        text-align: center;
        font-family: 宋体;
    }
    .header {
        position: relative;
        box-sizing: border-box;
        width: 100%;
        height: 70px;
        font-size: 22px;
        line-height: 70px;
        color: #fff;
    }
    .header .logo{
        float: left;
        width:310px;
        text-align: center;
    }
    .user-info {
        float: right;
        padding-right: 50px;
        font-size: 16px;
        color: #fff;
    }
    .user-info .el-dropdown-link{
        position: relative;
        display: inline-block;
        padding-left: 50px;
        color: #fff;
        cursor: pointer;
        vertical-align: middle;
    }
    .user-info .user-logo{
        position: absolute;
        left:0;
        top:15px;
        width:40px;
        height:40px;
        border-radius: 50%;
    }
    .el-dropdown-menu__item{
        text-align: center;
    }
</style>
